#ifndef SCEKERNEL_H
#define SCEKERNEL_H

#include "../types.h"

#define SCE_ERROR_LIST_BUSY                                     0x80000021
#define SCE_ERROR_LIST_OUT_OF_MEMORY                            0x80000022
   
#define SCE_ERROR_INVALID_LIST_ID                               0x80000100
#define SCE_ERROR_INDEX                                         0x80000102
#define SCE_ERROR_POINTER                                       0x80000103
#define SCE_ERROR_SIZE                                          0x80000104
#define SCE_ERROR_ARGUMENT                                      0x80000107
#define SCE_ERROR_FORMAT                                        0x80000108
   
#define SCE_ERROR_FILE_OPERATION_NOT_PERMITTED                  0x80010001
#define SCE_ERROR_FILE_NOT_FOUND                                0x80010002
#define SCE_ERROR_FILE_OPEN_ERROR                               0x80010003
#define SCE_ERROR_IO_ERROR                                      0x80010005
#define SCE_ERROR_ARG_LIST_TOO_LONG                             0x80010007
#define SCE_ERROR_INVALID_FILE_DESCRIPTOR                       0x80010009
#define SCE_ERROR_RESOURCE_UNAVAILABLE                          0x8001000b
#define SCE_ERROR_FILE_NO_MEMORY                                0x8001000c
#define SCE_ERROR_FILE_NO_PERM                                  0x8001000d
#define SCE_ERROR_FILE_INVALID_ADDR                             0x8001000e
#define SCE_ERROR_DEVICE_BUSY                                   0x80010010
#define SCE_ERROR_FILE_ALREADY_EXISTS                           0x80010011
#define SCE_ERROR_CROSS_DEV_LINK                                0x80010012
#define SCE_ERROR_DEVICE_NOT_FOUND                              0x80010013
#define SCE_ERROR_NOT_A_DIRECTORY                               0x80010014
#define SCE_ERROR_IS_DIRECTORY                                  0x80010015
#define SCE_ERROR_INVALID_ARGUMENT                              0x80010016
#define SCE_ERROR_TOO_MANY_OPEN_SYSTEM_FILES                    0x80010018
#define SCE_ERROR_FILE_IS_TOO_BIG                               0x8001001b
#define SCE_ERROR_DEVICE_NO_FREE_SPACE                          0x8001001c
#define SCE_ERROR_READ_ONLY                                     0x8001001e
#define SCE_ERROR_FILE_PATH_TOO_LONG                            0x80010024
#define SCE_ERROR_FILE_PROTOCOL                                 0x80010047
#define SCE_ERROR_DIRECTORY_IS_NOT_EMPTY                        0x8001005a
#define SCE_ERROR_TOO_MANY_SYMBOLIC_LINKS                       0x8001005c
#define SCE_ERROR_FILE_ADDR_IN_USE                              0x80010062
#define SCE_ERROR_CONNECTION_ABORTED                            0x80010067
#define SCE_ERROR_CONNECTION_RESET                              0x80010068
#define SCE_ERROR_NO_FREE_BUF_SPACE                             0x80010069
#define SCE_ERROR_FILE_TIMEOUT                                  0x8001006e
#define SCE_ERROR_NO_MEDIA                                      0x8001007b
#define SCE_ERROR_INVALID_MEDIUM                                0x8001007c
#define SCE_ERROR_FILE_QUOTA_EXCEEDED                           0x80010084

#define SCE_ERROR_CANNOT_BE_CALLED_FROM_INTERRUPT               0x80020064
#define SCE_ERROR_UNKNOWN_UID                                   0x800200cb
#define SCE_ERROR_UNMATCH_TYPE_UID                              0x800200cc
#define SCE_ERROR_NOT_EXIST_ID                                  0x800200cd
#define SCE_ERROR_NOT_FOUND_FUNCTION_UID                        0x800200ce
#define SCE_ERROR_ALREADY_HOLDER_UID                            0x800200cf
#define SCE_ERROR_NOT_HOLDER_UID                                0x800200d0
#define SCE_ERROR_ILLEGAL_PERMISSION                            0x800200d1
#define SCE_ERROR_ILLEGAL_ARGUMENT                              0x800200d2
#define SCE_ERROR_ILLEGAL_ADDR                                  0x800200d3
#define SCE_ERROR_MEMORY_AREA_OUT_OF_RANGE                      0x800200d4
#define SCE_ERROR_MEMORY_AREA_IS_OVERLAP                        0x800200d5
#define SCE_ERROR_ILLEGAL_PARTITION_ID                          0x800200d6
#define SCE_ERROR_PARTITION_IN_USE                              0x800200d7
#define SCE_ERROR_ILLEGAL_MEMBLOCK_ALLOC_TYPE                   0x800200d8
#define SCE_ERROR_FAILED_ALLOC_MEMBLOCK                         0x800200d9
#define SCE_ERROR_INHIBITED_RESIZE_MEMBLOCK                     0x800200da
#define SCE_ERROR_FAILED_RESIZE_MEMBLOCK                        0x800200db
#define SCE_ERROR_FAILED_ALLOC_HEAPBLOCK                        0x800200dc
#define SCE_ERROR_FAILED_ALLOC_HEAP                             0x800200dd
#define SCE_ERROR_ILLEGAL_CHUNK_ID                              0x800200de
#define SCE_ERROR_CANNOT_FIND_CHUNK_NAME                        0x800200df
#define SCE_ERROR_NO_FREE_CHUNK                                 0x800200e0

#define SCE_ERROR_MODULE_LINK_ERROR                             0x8002012c
#define SCE_ERROR_ILLEGAL_OBJECT_FORMAT                         0x8002012d
#define SCE_ERROR_UNKNOWN_MODULE                                0x8002012e
#define SCE_ERROR_UNKNOWN_MODULE_FILE                           0x8002012f
#define SCE_ERROR_FILE_READ_ERROR                               0x80020130
#define SCE_ERROR_MEMORY_IN_USE                                 0x80020131
#define SCE_ERROR_PARTITION_MISMATCH                            0x80020132
#define SCE_ERROR_MODULE_ALREADY_STARTED                        0x80020133
#define SCE_ERROR_MODULE_NOT_STARTED                            0x80020134
#define SCE_ERROR_MODULE_ALREADY_STOPPED                        0x80020135
#define SCE_ERROR_MODULE_CANNOT_STOP                            0x80020136
#define SCE_ERROR_MODULE_NOT_STOPPED                            0x80020137
#define SCE_ERROR_MODULE_CANNOT_REMOVE                          0x80020138
#define SCE_ERROR_EXCLUSIVE_LOAD                                0x80020139
#define SCE_ERROR_LIBRARY_IS_NOT_LINKED                         0x8002013a
#define SCE_ERROR_LIBRARY_ALREADY_EXISTS                        0x8002013b
#define SCE_ERROR_LIBRARY_NOT_FOUND                             0x8002013c
#define SCE_ERROR_ILLEGAL_LIBRARY_HEADER                        0x8002013d
#define SCE_ERROR_LIBRARY_IN_USE                                0x8002013e
#define SCE_ERROR_MODULE_ALREADY_STOPPING                       0x8002013f
#define SCE_ERROR_ILLEGAL_OFFSET_VALUE                          0x80020140
#define SCE_ERROR_ILLEGAL_POSITION_CODE                         0x80020141
#define SCE_ERROR_ILLEGAL_ACCESS_CODE                           0x80020142
#define SCE_ERROR_MODULE_MANAGER_BUSY                           0x80020143
#define SCE_ERROR_ILLEGAL_FLAG                                  0x80020144
#define SCE_ERROR_CANNOT_GET_MODULE_LIST                        0x80020145
#define SCE_ERROR_PROHIBIT_LOADMODULE_DEVICE                    0x80020146
#define SCE_ERROR_PROHIBIT_LOADEXEC_DEVICE                      0x80020147
#define SCE_ERROR_UNSUPPORTED_PRX_TYPE                          0x80020148
#define SCE_ERROR_ILLEGAL_PERMISSION_CALL                       0x80020149
#define SCE_ERROR_CANNOT_GET_MODULE_INFO                        0x8002014a
#define SCE_ERROR_ILLEGAL_LOADEXEC_BUFFER                       0x8002014b
#define SCE_ERROR_ILLEGAL_LOADEXEC_FILENAME                     0x8002014c
#define SCE_ERROR_NO_EXIT_CALLBACK                              0x8002014d

#define SCE_ERROR_NO_MEMORY                                     0x80020190
#define SCE_ERROR_ILLEGAL_ATTR                                  0x80020191
#define SCE_ERROR_ILLEGAL_THREAD_ENTRY_ADDR                     0x80020192
#define SCE_ERROR_ILLEGAL_PRIORITY                              0x80020193
#define SCE_ERROR_ILLEGAL_STACK_SIZE                            0x80020194
#define SCE_ERROR_ILLEGAL_MODE                                  0x80020195
#define SCE_ERROR_ILLEGAL_MASK                                  0x80020196
#define SCE_ERROR_ILLEGAL_THREAD                                0x80020197
#define SCE_ERROR_NOT_FOUND_THREAD                              0x80020198
#define SCE_ERROR_NOT_FOUND_SEMAPHORE                           0x80020199
#define SCE_ERROR_NOT_FOUND_EVENT_FLAG                          0x8002019a
#define SCE_ERROR_NOT_FOUND_MESSAGE_BOX                         0x8002019b
#define SCE_ERROR_NOT_FOUND_VPOOL                               0x8002019c
#define SCE_ERROR_NOT_FOUND_FPOOL                               0x8002019d
#define SCE_ERROR_NOT_FOUND_MESSAGE_PIPE                        0x8002019e
#define SCE_ERROR_NOT_FOUND_ALARM                               0x8002019f
#define SCE_ERROR_NOT_FOUND_THREAD_EVENT_HANDLER                0x800201a0
#define SCE_ERROR_NOT_FOUND_CALLBACK                            0x800201a1
#define SCE_ERROR_THREAD_ALREADY_DORMANT                        0x800201a2
#define SCE_ERROR_THREAD_ALREADY_SUSPEND                        0x800201a3
#define SCE_ERROR_THREAD_IS_NOT_DORMANT                         0x800201a4
#define SCE_ERROR_THREAD_IS_NOT_SUSPEND                         0x800201a5
#define SCE_ERROR_THREAD_IS_NOT_WAIT                            0x800201a6
#define SCE_ERROR_WAIT_CAN_NOT_WAIT                             0x800201a7
#define SCE_ERROR_WAIT_TIMEOUT                                  0x800201a8
#define SCE_ERROR_WAIT_CANCELLED                                0x800201a9
#define SCE_ERROR_WAIT_STATUS_RELEASED                          0x800201aa
#define SCE_ERROR_WAIT_STATUS_RELEASED_CALLBACK                 0x800201ab
#define SCE_ERROR_THREAD_IS_TERMINATED                          0x800201ac
#define SCE_ERROR_SEMA_ZERO                                     0x800201ad
#define SCE_ERROR_SEMA_OVERFLOW                                 0x800201ae
#define SCE_ERROR_EVENT_FLAG_POLL_FAILED                        0x800201af
#define SCE_ERROR_EVENT_FLAG_NO_MULTI_PERM                      0x800201b0
#define SCE_ERROR_EVENT_FLAG_ILLEGAL_WAIT_PATTERN               0x800201b1
#define SCE_ERROR_MESSAGEBOX_NO_MESSAGE                         0x800201b2
#define SCE_ERROR_MESSAGE_PIPE_FULL                             0x800201b3
#define SCE_ERROR_MESSAGE_PIPE_EMPTY                            0x800201b4
#define SCE_ERROR_WAIT_DELETE                                   0x800201b5
#define SCE_ERROR_ILLEGAL_MEMBLOCK                              0x800201b6
#define SCE_ERROR_ILLEGAL_MEMSIZE                               0x800201b7
#define SCE_ERROR_ILLEGAL_SCRATCHPAD_ADDR                       0x800201b8
#define SCE_ERROR_SCRATCHPAD_IN_USE                             0x800201b9
#define SCE_ERROR_SCRATCHPAD_NOT_IN_USE                         0x800201ba
#define SCE_ERROR_ILLEGAL_TYPE                                  0x800201bb
#define SCE_ERROR_ILLEGAL_SIZE                                  0x800201bc
#define SCE_ERROR_ILLEGAL_COUNT                                 0x800201bd
#define SCE_ERROR_NOT_FOUND_VTIMER                              0x800201be
#define SCE_ERROR_ILLEGAL_VTIMER                                0x800201bf
#define SCE_ERROR_ILLEGAL_KTLS                                  0x800201c0
#define SCE_ERROR_KTLS_IS_FULL                                  0x800201c1
#define SCE_ERROR_KTLS_IS_BUSY                                  0x800201c2
#define SCE_ERROR_MUTEX_NOT_FOUND                               0x800201c3
#define SCE_ERROR_MUTEX_LOCKED                                  0x800201c4
#define SCE_ERROR_MUTEX_UNLOCKED                                0x800201c5
#define SCE_ERROR_MUTEX_LOCK_OVERFLOW                           0x800201c6
#define SCE_ERROR_MUTEX_UNLOCK_UNDERFLOW                        0x800201c7
#define SCE_ERROR_MUTEX_RECURSIVE_NOT_ALLOWED                   0x800201c8
#define SCE_ERROR_MESSAGEBOX_DUPLICATE_MESSAGE                  0x800201c9
#define SCE_ERROR_LWMUTEX_NOT_FOUND                             0x800201ca
#define SCE_ERROR_LWMUTEX_LOCKED                                0x800201cb
#define SCE_ERROR_LWMUTEX_UNLOCKED                              0x800201cc
#define SCE_ERROR_LWMUTEX_LOCK_OVERFLOW                         0x800201cd
#define SCE_ERROR_LWMUTEX_UNLOCK_UNDERFLOW                      0x800201ce
#define SCE_ERROR_LWMUTEX_RECURSIVE_NOT_ALLOWED                 0x800201cf

#define SCE_ERROR_CANNOT_CANCEL                                 0x80020261

#define SCE_ERROR_TOO_MANY_OPEN_FILES                           0x80020320
#define SCE_ERROR_NO_SUCH_DEVICE                                0x80020321
#define SCE_ERROR_BAD_FILE_DESCRIPTOR                           0x80020323
#define SCE_ERROR_UNSUPPORTED_OPERATION                         0x80020325
#define SCE_ERROR_NOCWD                                         0x8002032c
#define SCE_ERROR_FILENAME_TOO_LONG                             0x8002032d
#define SCE_ERROR_ASYNC_BUSY                                    0x80020329
#define SCE_ERROR_NO_ASYNC_OP                                   0x8002032a

#define SCE_ERROR_UTILITY_INVALID_STATUS                        0x80110001
#define SCE_ERROR_UTILITY_INVALID_PARAM_ADDR                    0x80110002
#define SCE_ERROR_UTILITY_IS_UNKNOWN                            0x80110003
#define SCE_ERROR_UTILITY_INVALID_PARAM_SIZE                    0x80110004
#define SCE_ERROR_UTILITY_WRONG_TYPE                            0x80110005
#define SCE_ERROR_UTILITY_MODULE_NOT_FOUND                      0x80110006

#define SCE_ERROR_SAVEDATA_LOAD_NO_MEMSTICK                     0x80110301
#define SCE_ERROR_SAVEDATA_LOAD_MEMSTICK_REMOVED                0x80110302
#define SCE_ERROR_SAVEDATA_LOAD_ACCESS_ERROR                    0x80110305
#define SCE_ERROR_SAVEDATA_LOAD_DATA_BROKEN                     0x80110306
#define SCE_ERROR_SAVEDATA_LOAD_NO_DATA                         0x80110307
#define SCE_ERROR_SAVEDATA_LOAD_BAD_PARAMS                      0x80110308
#define SCE_ERROR_SAVEDATA_LOAD_NO_UMD                          0x80110309
#define SCE_ERROR_SAVEDATA_LOAD_INTERNAL_ERROR                  0x80110309

#define SCE_ERROR_SAVEDATA_RW_NO_MEMSTICK                       0x80110321
#define SCE_ERROR_SAVEDATA_RW_MEMSTICK_REMOVED                  0x80110322
#define SCE_ERROR_SAVEDATA_RW_MEMSTICK_FULL                     0x80110323
#define SCE_ERROR_SAVEDATA_RW_MEMSTICK_PROTECTED                0x80110324
#define SCE_ERROR_SAVEDATA_RW_ACCESS_ERROR                      0x80110325
#define SCE_ERROR_SAVEDATA_RW_DATA_BROKEN                       0x80110326
#define SCE_ERROR_SAVEDATA_RW_NO_DATA                           0x80110327
#define SCE_ERROR_SAVEDATA_RW_BAD_PARAMS                        0x80110328
#define SCE_ERROR_SAVEDATA_RW_FILE_NOT_FOUND                    0x80110329
#define SCE_ERROR_SAVEDATA_RW_CAN_NOT_SUSPEND                   0x8011032a
#define SCE_ERROR_SAVEDATA_RW_INTERNAL_ERROR                    0x8011032b
#define SCE_ERROR_SAVEDATA_RW_BAD_STATUS                        0x8011032c
#define SCE_ERROR_SAVEDATA_RW_SECURE_FILE_FULL                  0x8011032d

#define SCE_ERROR_SAVEDATA_DELETE_NO_MEMSTICK                   0x80110341
#define SCE_ERROR_SAVEDATA_DELETE_MEMSTICK_REMOVED              0x80110342
#define SCE_ERROR_SAVEDATA_DELETE_MEMSTICK_PROTECTED            0x80110344
#define SCE_ERROR_SAVEDATA_DELETE_ACCESS_ERROR                  0x80110345
#define SCE_ERROR_SAVEDATA_DELETE_DATA_BROKEN                   0x80110346
#define SCE_ERROR_SAVEDATA_DELETE_NO_DATA                       0x80110347
#define SCE_ERROR_SAVEDATA_DELETE_BAD_PARAMS                    0x80110348
#define SCE_ERROR_SAVEDATA_DELETE_INTERNAL_ERROR                0x8011034b

#define SCE_ERROR_SAVEDATA_SAVE_NO_MEMSTICK                     0x80110381
#define SCE_ERROR_SAVEDATA_SAVE_MEMSTICK_REMOVED                0x80110382
#define SCE_ERROR_SAVEDATA_SAVE_NO_SPACE                        0x80110383
#define SCE_ERROR_SAVEDATA_SAVE_MEMSTICK_PROTECTED              0x80110384
#define SCE_ERROR_SAVEDATA_SAVE_ACCESS_ERROR                    0x80110385
#define SCE_ERROR_SAVEDATA_SAVE_BAD_PARAMS                      0x80110388
#define SCE_ERROR_SAVEDATA_SAVE_NO_UMD                          0x80110389
#define SCE_ERROR_SAVEDATA_SAVE_WRONG_UMD                       0x8011038a
#define SCE_ERROR_SAVEDATA_SAVE_INTERNAL_ERROR                  0x8011038b

#define SCE_ERROR_SAVEDATA_SIZES_NO_MEMSTICK                    0x801103c1
#define SCE_ERROR_SAVEDATA_SIZES_MEMSTICK_REMOVED               0x801103c2
#define SCE_ERROR_SAVEDATA_SIZES_ACCESS_ERROR                   0x801103c5
#define SCE_ERROR_SAVEDATA_SIZES_DATA_BROKEN                    0x801103c6
#define SCE_ERROR_SAVEDATA_SIZES_NO_DATA                        0x801103c7
#define SCE_ERROR_SAVEDATA_SIZES_BAD_PARAMS                     0x801103c8
#define SCE_ERROR_SAVEDATA_SIZES_INTERNAL_ERROR                 0x801103cb

#define SCE_ERROR_NETPARAM_BAD_NETCONF                          0x80110601
#define SCE_ERROR_NETPARAM_BAD_PARAM                            0x80110604

#define SCE_ERROR_UMD_NOT_READY                                 0x80210001

#define SCE_ERROR_DEVCTL_BAD_PARAMS                             0x80220081

#define SCE_ERROR_AUDIO_CHANNEL_NOT_INIT                        0x80260001
#define SCE_ERROR_AUDIO_CHANNEL_BUSY                            0x80260002
#define SCE_ERROR_AUDIO_INVALID_CHANNEL                         0x80260003
#define SCE_ERROR_AUDIO_PRIV_REQUIRED                           0x80260004
#define SCE_ERROR_AUDIO_NO_CHANNELS_AVAILABLE                   0x80260005
#define SCE_ERROR_AUDIO_OUTPUT_SAMPLE_DATA_SIZE_NOT_ALIGNED     0x80260006
#define SCE_ERROR_AUDIO_INVALID_FORMAT                          0x80260007
#define SCE_ERROR_AUDIO_CHANNEL_NOT_RESERVED                    0x80260008
#define SCE_ERROR_AUDIO_NOT_OUTPUT                              0x80260009

#define SCE_ERROR_POWER_VMEM_IN_USE                             0x802b0200

#define SCE_ERROR_WLAN_BAD_PARAMS                               0x80410d13

#define SCE_ERROR_SAS_BUSY                                      0x80420030
#define SCE_ERROR_SAS_NOT_INIT                                  0x80420100

#define SCE_ERROR_WAVE_NOT_INIT                                 0x80440001
#define SCE_ERROR_WAVE_FAILED_EXIT                              0x80440002
#define SCE_ERROR_WAVE_BAD_VOL                                  0x8044000a
#define SCE_ERROR_WAVE_INVALID_CHANNEL                          0x80440010
#define SCE_ERROR_WAVE_INVALID_SAMPLE_COUNT                     0x80440011

#define SCE_ERROR_FONT_INVALID_LIBID                            0x80460002

#define SCE_ERROR_MPEG_BAD_VERSION                              0x80610002
#define SCE_ERROR_MPEG_NO_MEMORY                                0x80610022
#define SCE_ERROR_MPEG_INVALID_ADDR                             0x80610103
#define SCE_ERROR_MPEG_INVALID_VALUE                            0x806101fe

#define SCE_ERROR_PSMF_NOT_INITIALIZED                          0x80615001
#define SCE_ERROR_PSMF_BAD_VERSION                              0x80615002
#define SCE_ERROR_PSMF_NOT_FOUND                                0x80615025
#define SCE_ERROR_PSMF_INVALID_ID                               0x80615100
#define SCE_ERROR_PSMF_INVALID_VALUE                            0x806151fe
#define SCE_ERROR_PSMF_INVALID_TIMESTAMP                        0x80615500
#define SCE_ERROR_PSMF_INVALID_PSMF                             0x80615501

#define SCE_ERROR_MPEG_NO_DATA                                  0x80618001

#define SCE_ERROR_MPEG_VIDEO_FATAL                              0x80628002

#define SCE_ERROR_ATRAC_NO_ID                                   0x80630003
#define SCE_ERROR_ATRAC_INVALID_CODEC                           0x80630004
#define SCE_ERROR_ATRAC_BAD_ID                                  0x80630005
#define SCE_ERROR_ATRAC_ALL_DATA_LOADED                         0x80630009
#define SCE_ERROR_ATRAC_NO_DATA                                 0x80630010
#define SCE_ERROR_ATRAC_SECOND_BUFFER_NEEDED                    0x80630012
#define SCE_ERROR_ATRAC_SECOND_BUFFER_NOT_NEEDED                0x80630022
#define SCE_ERROR_ATRAC_BUFFER_IS_EMPTY                         0x80630023
#define SCE_ERROR_ATRAC_ALL_DATA_DECODED                        0x80630024

#define SCE_ERROR_MPEG_AUDIO_FATAL                              0x807f00fc

typedef s32 SceUID;
typedef u32 SceSize;
typedef s32 SceSSize;
typedef u8 SceUChar;
typedef u32 SceUInt;
typedef s32 SceMode;
typedef s64 SceOff;
typedef s64 SceIores;

/* Structure to pass to loadexec */
typedef struct
{
    /* Size of the structure */
    SceSize     size;
    /* Size of the arg string */
    SceSize     args;
    /* Pointer to the arg string */
    void *  argp;
    /* Encryption key? unused so far */
    const s8 *    key;
} SceKernelLoadExecParam;

void __KernelInit();
void __KernelShutdown();

#define MAXCOUNT 2048
#define HANDLEOFFSET 0x100

typedef enum
{
    KO_MODULE,
    KO_FILENODE,
    KO_DIRLISTING,
    KO_CALLBACK,
    KO_EVENTFLAG,
    KO_FPL,
    KO_VPL,
    KO_PARTMEM,
    KO_MUTEX,
    KO_LWMUTEX,
    KO_SEMAPHORE,
    KO_THREAD,
    KO_VTIMER,
    KO_FONTLIB,
    KO_SASCORE
} KoType;

typedef struct
{
    void *ptr;
    s8 occupied;
    KoType type;
    s32 uid;
} KernelObject;

typedef struct
{
    KernelObject pool[MAXCOUNT]; /* TODO: STATIC */
} KernelObjectPool;

void kop_init();
void *ko_get(SceUID handle);
void ko_free(SceUID handle);
SceUID ko_init(void *obj, KoType type);
void *ko_search(SceUID handle, KoType type);
void kop_clear();
s32 kop_getCount();

#endif

